package com.system.stockservice.bus;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
//@RabbitListener(queues = "orderserver3")
public class TestReceiver {

//    @RabbitHandler
    public void process(String msg){
        Object parse = JSON.parse(msg);
        JSONObject jsonObject = JSONObject.parseObject(msg);
        String orderId = jsonObject.getString("orderId");
        System.out.println(orderId);
        System.out.println(parse);
        System.out.println("公共服务收到来自用户服务的消息: "+msg);
    }




}
